<!DOCTYPE html>
<head>
  <style>

.demo > * {
  width: 250px;
  height: 200px;
  padding: 1em;
}

.demo > * + * {
  margin-top: -150px;
  opacity: 0.75;
}

.demo > :first-child {
  background: aliceblue;
  border: 12px solid red;
  z-index: 4;
}

.demo > :nth-child(2) {
  background: pink;
  border: 2px solid blue;
  margin-left: 50px;
  z-index: 1;
}

.demo > :last-child {
  background: wheat;
  border: 2px solid gold;
  z-index: 4;
  margin-left: 25px;
}
    </style>
</head>
<body>
<div class="demo">
  <div class="demo-box"><code>z-index: 3;</code></div>
  <div class="demo-box"><code>z-index: 1;</code></div>
  <div class="demo-box"><code>z-index: 2;</code></div>
</div>
</body>
</#html>
